﻿using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Unity;

namespace Tnelab.MBWrapper
{
    public static class WebViewFactory
    {
        public static IWebView Create(IntPtr parentHandle,Action<Action> uiInvoke)
        {
            if (File.Exists("mb.dll"))
            {
                return new VipWebView(parentHandle, uiInvoke);
            }
            return new WkeWebView(parentHandle, uiInvoke);
        }
        public static IServiceWebView CreateServiceAble(IntPtr parentHandle, Action<Action> uiInvoke, IUnityContainer serviceContainer)
        {
            return new ServiceWebView(Create(parentHandle, uiInvoke), serviceContainer);
        }
    }
}
